# class Solution:
#     def smallerNumbersThanCurrent(self, nums: List[int]) -> List[int]:
#         a=nums[:]
#         a.sort()
#         mapper={}
#         for index,i in enumerate(a):
#             if i not in mapper.keys():
#                 mapper[i]=index
#         return [mapper[j] for j in nums]

class Solution:
    def smallerNumbersThanCurrent(self, nums: List[int]) -> List[int]:
        a=nums[:]
        a.sort(reverse=True)
        mapper={}
        for index,i in enumerate(a):
            mapper[i]=len(nums)-index-1
        return [mapper[j] for j in nums]